﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo04
{
    class Program
    {
        static void Main(string[] args)
        {
            int e;
            int r;
            int t;
            int f;
            Console.WriteLine("请输入一个4位数：");
            int a = int.Parse(Console.ReadLine());
            e =a / 1000;
            r = (a - e * 1000) / 100;
            t = (a - e * 1000 - r * 100) / 10;
            f = (a - e * 1000 - r * 100 - t * 10) / 1;
            Console.WriteLine("千位为："+e);
            Console.WriteLine("百位为："+r);
            Console.WriteLine("十位为："+t);
            Console.WriteLine("个位为："+f);

            Console.ReadKey();
        }
    }
}
